Skip to content

feat: save/load project state (.trp files)#23

Open
JWBWork wants to merge 2 commits intoraycastly:masterfrom
JWBWork:feature/save-load
Open

feat: save/load project state (.trp files)#23
JWBWork wants to merge 2 commits intoraycastly:masterfrom
JWBWork:feature/save-load

Conversation

@JWBWork
Copy link
Copy Markdown

@JWBWork JWBWork commented Apr 10, 2026

Summary

  • File > Save/Open in Electron (Ctrl+S/O) with native dialogs
  • Browser fallback via file download / file picker (untested)
  • Serializes both panels: source images, polygon rects (with curved midpoints), extracted textures, atlas dimensions and transparency

Test plan

  • Save project, close app, reopen and load — all images, rects, and textures restored
  • Polygon midpoint curves preserved correctly after load
  • Tested in Electron desktop app
  • Tested in browser

🤖 Generated with Claude Code

JWBWork and others added 2 commits April 10, 2026 10:10
- File menu in Electron with Save/Open (Ctrl+S/O)
- Browser fallback via download/file-input
- Serializes both panels: images, polygons, textures, atlas settings
- Fix polygon vertex reorder on load (skipReorder parameter)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move file I/O from main process IPC to renderer process (fs module)
  to avoid Electron IPC size limits on large payloads
- Show dialog first, then serialize — prevents UI hang before dialog
- Use JPEG for source images in save files to avoid V8 string length
  limit (RangeError) when serializing many full-resolution PNGs
- Keep PNG for extracted textures (transparency support)
- Add fallback to naturalWidth/naturalHeight when loading textures
  without explicit dimensions
- Add spinner modal overlay during save/load operations
- Add error handling with user-visible feedback on failure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant